#include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <algorithm>
#include <map>
#include <climits>


using namespace std;
class Solution {
public:
    /*
    [10,20,30,5,10,50]
    */
    int maxAscendingSum(vector<int>& nums) {
        int len=nums.size();
        if(0==len) return 0;
        int ans=nums[0],sum=nums[0];
        for(int i=1;i<len;i++){
            if(nums[i]>nums[i-1]){
                sum+=nums[i];
            }else{
                ans=max(sum,ans);
                sum=nums[i];
            }
        }
        ans=max(ans,sum);
        return ans;
    }
};

int main(){

    Solution s;
    vector<int> v={100,10,1};
    cout << s.maxAscendingSum(v)<<endl;


    return 0;
}